import { defineMock } from './config'
import { successResponseWrap } from '../src/utils/setup-mock'
const data = {
  id: '1000',
  name: 'root',
  index: 0,
  level: 0,
  isRoot: true,
  isLeaf: false,
  type: 0,
  code: 'root',
  quickCode: 'root',
  alias: 'root',
  isShow: true,
  isOpen: false,
  status: 1,
  children: [
    {
      id: '3000',
      parentId: '1000',
      name: '仪表盘',
      index: 0,
      level: 2,
      isRoot: false,
      isLeaf: false,
      type: 0,
      code: 'dashboard',
      quickCode: 'dashboard',
      alias: '仪表盘',
      isShow: true,
      isOpen: false,
      status: 1,
      clientRouter: '/dashboard',
      children: [
        {
          id: '3001',
          parentId: '3000',
          name: '仪表盘',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'workplace',
          quickCode: 'workplace',
          alias: '仪表盘',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/dashboard/workplace',
          children: [],
        },
      ],
      operations: [],
    },
    {
      id: '4000',
      parentId: '1000',
      name: '列表页',
      index: 0,
      level: 1,
      isRoot: false,
      isLeaf: false,
      type: 0,
      code: 'group',
      quickCode: 'table',
      alias: '表格',
      isShow: true,
      isOpen: false,
      status: 1,
      clientRouter: '/table',
      children: [
        {
          id: '4001',
          parentId: '4000',
          name: '基础表格',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'base',
          quickCode: 'base',
          alias: '基础表格',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/table/base',
          children: [],
        },
        {
          id: '4002',
          parentId: '4000',
          name: '分栏表格',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'tree',
          quickCode: 'tree',
          alias: '分栏表格',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/table/tree',
          children: [],
        },
        {
          id: '4003',
          parentId: '4000',
          name: '条件联动',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'cascader',
          quickCode: 'cascader',
          alias: '条件联动',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/table/cascader',
          children: [],
        },
      ],
    },
    {
      id: '5000',
      parentId: '1000',
      name: '表单页',
      index: 0,
      level: 1,
      isRoot: false,
      isLeaf: false,
      type: 0,
      code: 'form',
      quickCode: 'form',
      alias: '表单',
      isShow: true,
      isOpen: false,
      status: 1,
      clientRouter: '/form',
      children: [
        {
          id: '5001',
          parentId: '5000',
          name: '分组表格',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'group',
          quickCode: 'group',
          alias: '分组表格',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/form/group',
          children: [],
        },
        {
          id: '5002',
          parentId: '5000',
          name: '分布表格',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'step',
          quickCode: 'step',
          alias: '分布表格',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/form/step',
          children: [],
        },
      ],
    },
    {
      id: '6000',
      parentId: '1000',
      name: '基础组件',
      index: 0,
      level: 1,
      isRoot: false,
      isLeaf: false,
      type: 0,
      code: 'component',
      quickCode: 'component',
      alias: '组件',
      isShow: true,
      isOpen: false,
      status: 1,
      clientRouter: '/component',
      children: [],
    },
    {
      id: '7000',
      parentId: '1000',
      name: '异常管理',
      index: 0,
      level: 1,
      isRoot: false,
      isLeaf: false,
      type: 0,
      code: 'ex',
      quickCode: 'ex',
      alias: '异常管理',
      isShow: true,
      isOpen: false,
      status: 1,
      clientRouter: '/exception',
      children: [
        {
          id: '7001',
          parentId: '7000',
          name: '403',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: '403',
          quickCode: '403',
          alias: '403',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/exception/403',
          children: [],
        },
        {
          id: '7002',
          parentId: '7000',
          name: '404',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: '404',
          quickCode: '404',
          alias: '404',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/exception/404',
          children: [],
        },
        {
          id: '7003',
          parentId: '7000',
          name: '500',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: '500',
          quickCode: '500',
          alias: '500',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/exception/500',
          children: [],
        },
      ],
    },
    {
      id: '9100',
      parentId: '1000',
      name: '系统管理',
      index: 0,
      level: 1,
      isRoot: false,
      isLeaf: false,
      type: 0,
      code: 'sys',
      quickCode: 'xtgl',
      alias: '系统',
      isShow: true,
      isOpen: false,
      status: 1,
      clientRouter: '/system',
      children: [
        {
          id: '9101',
          parentId: '9100',
          name: '字典管理',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'doct',
          quickCode: 'zdgl',
          alias: '字典',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/system/dictionaries',
          children: [],
          operations: [
            {
              id: '910100',
              name: '新增字典',
              alias: '新增字典',
              code: 'dict-add',
              quickCode: 'xzzd',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910101',
              name: '删除字典',
              alias: '删除字典',
              code: 'dict-remvoe',
              quickCode: 'yczd',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910102',
              name: '更新字典',
              alias: '修改字典',
              code: 'dict-update',
              quickCode: 'xgzd',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910103',
              name: '字典列表',
              alias: '字典列表',
              code: 'dict-list',
              quickCode: 'hqzdlb',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910104',
              name: '获取字典',
              alias: '获取字典',
              code: 'dict-get',
              quickCode: 'hqzd',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910105',
              name: '新增字典项',
              alias: '新增字典项',
              code: 'dictitem-add',
              quickCode: 'xzzdx',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910106',
              name: '删除字典项',
              alias: '删除字典项',
              code: 'dictitem-remvoe',
              quickCode: 'yczdx',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910107',
              name: '更新字典项',
              alias: '修改字典项',
              code: 'dictitem-update',
              quickCode: 'xgzdx',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910108',
              name: '字典项列表',
              alias: '字典项列表',
              code: 'dictitem-list',
              quickCode: 'zdxlb',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
            {
              id: '910109',
              name: '获取字典项',
              alias: '获取字典项',
              code: 'dictitem-get',
              quickCode: 'hqzdx',
              type: 0,
              isShow: true,
              isOpen: false,
              status: 1,
            },
          ],
        },
        {
          id: '9001',
          parentId: '9000',
          name: '角色管理',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'role',
          quickCode: 'jsgl',
          alias: '角色',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/system/role',
          children: [],
        },
        {
          id: '9003',
          parentId: '9000',
          name: '用户管理',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'user',
          quickCode: 'yhgl',
          alias: '用户',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/system/user',
          children: [],
        },
        {
          id: '9108',
          parentId: '9100',
          name: '系统菜单',
          index: 0,
          level: 2,
          isRoot: false,
          isLeaf: false,
          type: 0,
          code: 'menu',
          quickCode: 'xtcd',
          alias: '菜单',
          isShow: true,
          isOpen: false,
          status: 1,
          clientRouter: '/system/menu',
          children: [],
          operations: [],
        },
      ],
      operations: [],
    },
  ],
  operations: [],
}

export default defineMock([
  {
    url: '/sys/list',
    method: 'get',
    timeout: 50,
    response: () => {
      return successResponseWrap({
        data,
      })
    },
  },
])
